package com.chenl.provider.DEMOS.全局参数校验和异常捕获;

import com.chenl.provider.DTO.UserInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@Slf4j
@RestController
@RequestMapping("/valid")
public class Controller{
    @PostMapping("/test")
    public String test(@Validated @RequestBody UserInfo userInfo){
        return "ok";
    }
}
